import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryGeneralFileHistory = (params) => {
  params.head.transCode = 'queryGeneralFileHistory';
  return request({
    url: '/general/generalFileHistory/queryGeneralFileHistory',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryGeneralFileHistoryListPage = (params) => {
  params.head.transCode = 'queryGeneralFileHistoryListPage';
  return request({
    url: '/general/generalFileHistory/queryGeneralFileHistoryListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveGeneralFileHistory = (params) => {
  params.head.transCode = 'saveGeneralFileHistory';
  return request({
    url: '/general/generalFileHistory/saveGeneralFileHistory',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveGeneralFileHistoryList = (params) => {
  params.head.transCode = 'saveGeneralFileHistoryList';
  return request({
    url: '/general/generalFileHistory/saveGeneralFileHistoryList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateGeneralFileHistory = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralFileHistory';
  return request({
    url: '/general/generalFileHistory/saveOrUpdateGeneralFileHistory',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateGeneralFileHistoryList = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralFileHistoryList';
  return request({
    url: '/general/generalFileHistory/saveOrUpdateGeneralFileHistoryList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateGeneralFileHistory = (params) => {
  params.head.transCode = 'updateGeneralFileHistory';
  return request({
    url: '/general/generalFileHistory/updateGeneralFileHistory',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteGeneralFileHistory = (params) => {
  params.head.transCode = 'deleteGeneralFileHistory';
  return request({
    url: '/general/generalFileHistory/deleteGeneralFileHistory',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteGeneralFileHistoryList = (params) => {
  params.head.transCode = 'deleteGeneralFileHistoryList';
  return request({
    url: '/general/generalFileHistory/deleteGeneralFileHistoryList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportGeneralFileHistoryExcel = (params) => {
  downloadExcel({
    url: '/general/generalFileHistory/exportGeneralFileHistoryExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
